package com.example.demo.vo;

import com.example.demo.annotation.ValidGroups;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.util.Date;

@Data
public class UserValidated {
    @NotBlank(message = "id不允许为空", groups = ValidGroups.Update.class)
    private int id;

    @NotBlank(message = "username不允许为空")
    @Length(min = 4,max = 8,message = "username长度要在4-8之间")
    private String username;

    @NotBlank(message = "国家不能为空")
    private String country;

    @NotEmpty(message = "银行卡账号不能为空")
    private String bank;


    @Email(message = "邮箱格式不正确")
    private String email;
    @Max(value = 200,message = "年龄最大不能超过200")
    @Min(value = 10,message = "年龄最小不能小于10岁")
    private int age;
    private Integer salary;
    private Date date;
}
